package com.yanzhen.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yanzhen.model.ApplyEvent;
import com.yanzhen.dao.ApplyEventMapper;
import com.yanzhen.service.ApplyEventService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 王文龙
 * @since 2023-05-13
 */
@Service
public class ApplyEventServiceImpl extends ServiceImpl<ApplyEventMapper, ApplyEvent> implements ApplyEventService {

    @Autowired
    private ApplyEventMapper appEventDao;

    @Override
    public void update(ApplyEvent entity) {
        appEventDao.updateById(entity);
    }

    @Override
    public PageInfo<ApplyEvent> queryAppEventByPage(int page, int limit, ApplyEvent applyEvent) {
        PageHelper.startPage(page,limit);
        List<ApplyEvent> applyEvents = appEventDao.queryApplyList(applyEvent);
        PageInfo<ApplyEvent> pageInfo=new PageInfo<>(applyEvents);
        return pageInfo;
    }

    @Override
    public List<ApplyEvent> queryAppListByAppId(int id) {
        return appEventDao.queryAppListByAppId(id);
    }



    @Override
    public int updateAppList(ApplyEvent applyEvent) {
        return appEventDao.updateAppList(applyEvent);
    }

    @Override
    public void deleteById(int id) {
        appEventDao.deleteById(id);
    }
}
